function selectColorRange(scObj){
    var desc = new ActionDescriptor();
    desc.putInteger( charIDToTypeID( "Fzns" ), 5 );
        var cDesc = new ActionDescriptor();
        cDesc.putDouble( charIDToTypeID( "Rd  " ), scObj.rgb.red);
        cDesc.putDouble( charIDToTypeID( "Grn " ), scObj.rgb.green);
        cDesc.putDouble( charIDToTypeID( "Bl  " ), scObj.rgb.blue );
    desc.putObject( charIDToTypeID( "Mnm " ), charIDToTypeID( "RGBC" ), cDesc );
    desc.putObject( charIDToTypeID( "Mxm " ), charIDToTypeID( "RGBC" ), cDesc );
   executeAction( charIDToTypeID( "ClrR" ), desc, DialogModes.NO );
}

selectColorRange(app.foregroundColor);